package com.personal.baseDao;


import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.Properties;

import org.junit.Test;

public class DaoGenDBTest {

	@Test
	public void testReadPropertiesFile() {
//		Properties prop = DaoGenDB.readPropertiesFile();
//		Iterator<String>  it = prop.stringPropertyNames().iterator();
//		while(it.hasNext()){
//			String key = it.next();
//			System.out.println(key+","+prop.getProperty(key));
//		}
		Connection conn = DaoGenDB.getConn();
		try {
			PreparedStatement pstmt = conn.prepareStatement("select * from sso_user where user_id = 392396");
			ResultSet rs = pstmt.executeQuery();
			while(rs.next()){
				System.out.println(rs.getInt("user_id"));
				System.out.println(rs.getTime("CREATE_TIME"));
				System.out.println(rs.getString("email"));
				System.out.println(rs.getString("LOGIN_NAME"));
				System.out.println(rs.getString("LOGIN_PWD"));
				System.out.println(rs.getString("MOBILE"));
			}
			pstmt.close();
			conn.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
